package common;

import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;

import com.hichip.campro.R;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;

import bean.MyCamera;

public class HiDataValue {
	public final static boolean isDebug=false;
	public final static int DEFAULT_VIDEO_QUALITY = 1;
	public final static int DEFAULT_ALARM_STATE = 0;
	public final static int DEFAULT_PUSH_STATE = 0;//0关闭，1开启

	public final static int NOTICE_RUNNING_ID = 20001;
	public final static int NOTICE_ALARM_ID = 20002;
	public final static int REQUEST_CODE_ASK_PERMISSON=20003;

	public static int ANDROID_VERSION=0;


	public final static String EXTRAS_KEY_UID = "uid";
	public final static String EXTRAS_KEY_DATA = "data";
	public final static String EXTRAS_RF_TYPE = "rfType";
	public final static String START_WITH_IPCAM="IPCAM-";



	public final static String ACTION_CAMERA_INIT_END= "camera_init_end";
	//已经废弃了
	public final static String CAMERA_OLD_ALARM_ADDRESS= "49.213.12.136";
	public final static String CAMERA_ALARM_ADDRESS= "47.91.149.233";//
	public final static String CAMERA_ALARM_ADDRESS_122= "47.75.171.122";// t  w  u

	//Add XXXX YYYY ZZZZ server address
	public static final String CAMERA_ALARM_ADDRESS_THERE = "47.90.64.173";

	public final static int HANDLE_MESSAGE_SESSION_STATE = 0x90000001;
	public final static int HANDLE_MESSAGE_RECEIVE_IOCTRL = 0x90000003;
	public final static int HANDLE_MESSAGE_SCAN_RESULT = 0x90000005;
	public final static int HANDLE_MESSAGE_SCAN_CHECK = 0x90000006;
	public final static int HANDLE_MESSAGE_DOWNLOAD_STATE=0x90000007;
	public final static int HANDLE_MESSAGE_DELETE_FILE=0X10001;

	public final static int HANDLE_MESSAGE_PLAY_STATE = 0x80000001;
	public final static int HANDLE_MESSAGE_PROGRESSBAR_RUN = 0x80000002;

	public static List<MyCamera> CameraList = new ArrayList<MyCamera>();
	public static List<MyCamera> DeleteCameraList = new ArrayList<MyCamera>();
	public static String[] zifu={"&","'","~","*","(",")","/","\"","%","!",":",";",".","<",">",",","'"};

	public static boolean isOnLiveView = false;
	public static final String STYLE="style";

	public static String XGToken;
	//连接限制,前缀UID
	public static final String limit[] = {"FDTAA","DEAA","AAES"};

	public static final String[] SUBUID={"XXXX","YYYY","ZZZZ"};
	public static final String[] SUBUID_WTU={"WWWW","TTTT","UUUU"};
	public static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static final String DB_NAME="HiChipCamera.db";
	//推送 的公司名
	public static final String company = "camhipro";
	public static final String APP_NAME="CamHiPro";


	public static  final String CACHE="cache";

	//1: 保存每个Camera 缩略图的路径
	public static String getPathCameraThumbnail(String  uid,Context context){
		if(!TextUtils.isEmpty(uid)){
			return context.getFilesDir() + "/android/data/" + APP_NAME + "/"+uid+"/Thumbnail/";
		}
		return  "";
	}

	//2: 保存每个Camera 抓拍相册(本地照片) 的路径
	public static String getPathCameraSnapshot(String uid, Context context){
        if(!TextUtils.isEmpty(uid)){
			return context.getFilesDir() + "/android/data/" + APP_NAME + "/"+uid+"/Snapshot/";
		}
		return "";
	}

	//3:保存每个Camera 本地录像—远程录像下载 的路径
	public  static  String getPathCameraVideoOnLineDownLoad(String uid,Context context){
		if(!TextUtils.isEmpty(uid)){
			return context.getFilesDir() + "/android/data/" + APP_NAME + "/"+uid+"/Download/";
		}
		return "";
	}

	//4:保存每个Camera 本地录像—本地录像 的路径
	public  static String getPathCameraVideoLocalRecord(String uid,Context context){
		if(!TextUtils.isEmpty(uid)){
			return context.getFilesDir() + "/android/data/" + APP_NAME + "/"+uid+"/VideoRecoding/";
		}
		return "";
	}

	//5:保存h264，avi 转换成MP4  放到相册去观看（层级太多了 扫描图库更新就有问题）
	public static final String LOCAL_CONVERT_PATH=Environment.getExternalStorageDirectory().getAbsolutePath() +"/Convert/";

	//6:保存每个Camera 录像缩略图的路径
	public  static String getPathCameraLocalRecordSnapShot(String uid,Context context){
		if(!TextUtils.isEmpty(uid)){
			return context.getFilesDir() + "/android/data/" + APP_NAME + "/"+uid+"/VideoRecoding/"+"SnapShot/";
		}
		return "";
	}


}
